phpCopy<?php
$Object = new DateTime();
$DateAndTime = $Object->format("d-m-Y h:i:s a");
echo "The current date and time are $DateAndTime.";
?>
phpCopy<?php
$DateAndTime = date('m-d-Y h:i:s a', time());
echo "The current date and time are $DateAndTime.";
?>